<%--
  Created by IntelliJ IDEA.
  User: Teacher
  Date: 2025/9/11
  Time: 13:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>文件上传</title>
</head>
<body>
<h1>文件上传</h1>
<hr>
<!--
    想要实现文件上传,需要将表单数据设置为二进制流的方式进行数据传输
    因此,表单需要满足两个条件
    1.表单提交方式必须是post
    2.表单数据传输方式必须是multipart/form-data
-->
<form action="${pageContext.request.contextPath}/upload.file" method="post" enctype="multipart/form-data">
    用户名:<input type="text" name="username"><br>
    文&nbsp;&nbsp;&nbsp;件:<input type="file" name="file"><br>
    <input type="submit" value="提交">
    <span style="color: red">${uploadMsg}</span>
</form>
</body>
</html>
